const auth = (req, res, next) => {
  if (!req.session.user) {
    res.redirect("/users/login");
  } else {
    console.log(req.session.user);
    req.user = req.session.user;
    next();
  }
};

module.exports = auth;
